// TMap.h: interface for the TMap class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TMAP_H__55FD9B25_3A74_4D7E_8DCE_12900932E415__INCLUDED_)
#define AFX_TMAP_H__55FD9B25_3A74_4D7E_8DCE_12900932E415__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//#include "TCrossWnd.h"
#include "TMapNavigate.h"

class TMap  
{
	friend class TMapNavigate;

public:
	void UpdateSettings();
	BOOL CreateNavigate(HWND view);
	//void CreateCross(HWND view, TCrossWnd *pcw);
	void UpdateCross();
	BOOL ZoomOut();
	BOOL ZoomIn();
	BOOL LoadMapFromPicture(LPCTSTR filePath);
	BOOL LoadMapFromMostPicture(LPCTSTR filePath);
	void UpdateSize(CSize *size);
	void Draw(CDC* pDC);
	void BeginMove(CPoint *point);
	void EndMove(CPoint *point);
	void UpdateMap();
	CPoint MpToVp(const CPoint &mp);
	CPoint VpToMp(const CPoint &vp);
	TMap();
	~TMap();	

protected:
	HBITMAP m_hBMsrc;
	HBITMAP m_hBMdis;
	CRect	m_rcView;
	CPoint	m_ptCenter;
	CSize	m_sizeDis;
	CDC		m_DCdis;
	CDC		m_DCsrc;
	float	m_fZoom;

	float max_zoom;
	float min_zoom;
	float m_off;

	TMapNavigate m_navigate;
};

#endif // !defined(AFX_TMAP_H__55FD9B25_3A74_4D7E_8DCE_12900932E415__INCLUDED_)
